<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<table style="text-align: center" border="1px">
  <caption>文件上传</caption>
  <tbody>
    <tr>
      <th>标识id</th>
      <th>原始名称</th>
      <th>新名称</th>
      <th>文件类型</th>
      <th>文件大小(KB)</th>
      <th>是否私有</th>
      <th>作者</th>
      <th>上传时间</th>
      <th>下载次数</th>
      <th>操作</th>
    </tr>
    <tr th:each="file:${files}">
      <td><span th:text="${file.id}"></span></td>
      <td><span th:text="${file.originName}"></span></td>
      <td><span th:text="${file.fileName}"></span></td>
      <td><span th:text="'.' + ${file.type}"></span></td>
      <td><span th:text="${file.size}"></span></td>
      <td th:style="${file.flags==0}?'color:blue':'color:red'"><span th:text="${file.flags}==0?'否':'是'"></span></td>
<!--      <td style="color: red"><span th:if="${file.flags}==1" th:text="是"></span></td>-->
      <td><span th:text="${file.username}"></span></td>
      <td><span th:text="${file.gmtCreate}"></span></td>
      <td><span th:text="${file.counts}"></span></td>
      <td>
        <a th:href="@{/file/download(id=${file.id})}">下载</a>
        <a th:href="@{/file/delete(id=${file.id})}">删除</a>
      </td>
    </tr>
  </tbody>
</table>
<hr style="width: 100%;">
<h3>上传文件</h3>
<form action="/file/uploadFile" method="post" enctype="multipart/form-data">
  <input type="file" name="file">
  <input type="submit" value="确认上传">
</form>
</body>
</html>